home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / nt4.0 workstation / DRVLIB.NIC / 3C770 / OEMSETUP.INF < prev    next >
Encoding:
INI File  |  1996-07-27  |  36.1 KB  |  1,156 lines

  1. ;***********************************************************************
  2. ;
  3. ; OEMSETNT.INF
  4. ;
  5. ;       3COM 3C770 network card and driver SETUP INF file.
  6. ;
  7. ;***********************************************************************
  8.  
  9. ;-----------------------------------------------------------------------
  10. ; OPTION TYPE
  11. ; -----------
  12. ; This identifies the Option type we are dealing with.  The different
  13. ; possible types are:
  14. ;
  15. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  16. ;
  17. ;  Types specific to networking:
  18. ;
  19. ; NetAdapter,        a netcard / adapter combination or just a netcard
  20. ; NetDriver,         just a netcard driver
  21. ; NetTransport,      a complete NDIS-compliant TDI transport stack
  22. ; NetService,        an NT networking service
  23. ; NetWork,           a complete network ensemble.
  24. ; NetProvider        a complete network which supports NT MPR protocol
  25. ;-----------------------------------------------------------------------
  26.  
  27. [Identification]
  28.     OptionType = NetAdapter
  29.  
  30. [Signature]
  31.     FileType = MICROSOFT_DRVLIB_FILE
  32. [GetSignature]
  33.     read-syms Signature
  34.     return $(FileType)
  35.  
  36. ;-----------------------------------------------------------------------
  37. ; PlatformsSupported
  38. ; ------------------
  39. ; This identifies the platforms supported by the adapter card.
  40. ; Possible types are:
  41. ;
  42. ; ISA, EISA and MCA
  43. ;-----------------------------------------------------------------------
  44.  
  45. [PlatformsSupported]
  46.     EISA
  47.     "Jazz-Internal Bus"
  48.  
  49. ;-----------------------------------------------------------------------
  50. ; LANGUAGES SUPPORTED
  51. ; -------------------
  52. ;
  53. ; The languages supported by the OEM INF, For every language supported
  54. ; we need to have a separate text section for every displayable text
  55. ; section.
  56. ;
  57. ;-----------------------------------------------------------------------
  58.  
  59. [LanguagesSupported]
  60.     ENG
  61.  
  62. ;-----------------------------------------------------------------------
  63. ; OPTION LIST
  64. ; -----------
  65. ; This section lists the OEM Option key names.  These keys are locale
  66. ; independent and used to represent the option in a locale independent
  67. ; manner.
  68. ;
  69. ;-----------------------------------------------------------------------
  70.  
  71. [Options]
  72.     flnk
  73.  
  74. ;-----------------------------------------------------------------------
  75. ; OPTION TEXT SECTION
  76. ; -------------------
  77. ; These are text strings used to identify the option to the user.  There
  78. ; are separate sections for each language supported.  The format of the
  79. ; section name is "OptionsText" concatenated with the Language represented
  80. ; by the section.
  81. ;
  82. ;-----------------------------------------------------------------------
  83.  
  84. [OptionsTextENG]
  85.     flnk = "3COM FDDILINK EISA LAN Adapter"
  86.  
  87.  
  88. [Files-Inf]
  89. 1, oemsetnt.inf, SIZE=65535, RENAME=$(!UG_Filename)
  90.  
  91.  
  92. [Files-flnk]
  93. 1, flnk.SYS, SIZE=65535
  94.  
  95. ;***********************************************************************
  96. ; CONSTANTS FOR USING DIALOGS
  97. ;***********************************************************************
  98.  
  99. [FileConstants]
  100. ;
  101. ;  File names, etc.
  102. ;
  103. UtilityInf      = "UTILITY.INF"
  104. subroutineinf   = "SUBROUTN.INF"
  105. SoftwareType    = "driver"
  106. Exit_Code       = 0
  107.  
  108. ;
  109. ; EventLog Message File
  110. ;
  111. NetEventDLL     = "%SystemRoot%\System32\netevent.dll"
  112. IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
  113.  
  114. ; Product Info
  115. ;
  116. Manufacturer    =  "3COM"
  117. ProductMajorVersion     = "3"
  118. ProductMinorVersion     = "1"
  119. ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
  120. ;
  121. ; Software
  122. ;
  123. ProductSoftwareName     = "flnk"
  124. ProductSoftwareTitle    = "3COM FDDILINK LAN Adapter Driver"
  125. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\flnk.sys"
  126. NetRuleSoftwareType     = "flnkSys ndisDriver flnkDriver"
  127. NetRuleSoftwareUse      = $(SoftwareType)
  128. NetRuleSoftwareBindForm = """flnkSys"" yes no container"
  129. NetRuleSoftwareClass    = {"flnkDriver basic"}
  130. NetRuleSoftwareBindable = {"flnkDriver flnkAdapter non exclusive 100"}
  131. ;
  132. ; Hardware
  133. ;
  134. ProductHardwareName     = "flnk"
  135. ProductHardwareTitle    = "3COM FDDILINK Adapter"
  136. NetRuleHardwareType     = "flnk flnkAdapter"
  137. NetRuleHardwareBindForm = " yes yes container"
  138. NetRuleHardwareClass    = {"flnkAdapter basic"}
  139. ;
  140. ;  EISA System ID Info
  141. ;
  142. NETCARD_ID      = 7826768
  143.  
  144. ;
  145. ; Registry Key
  146. ;
  147. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  148. ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  149.  
  150. [ProductType]
  151. STF_PRODUCT  = Winnt
  152. STF_PLATFORM = I386
  153.  
  154. [GeneralConstants]
  155. ;
  156. ;  Program flow control variables.
  157. ;
  158. from      = ""
  159. to        = ""
  160. ;
  161. ;  Return codes; Exit_Code is set to one of these
  162. ;
  163. ExitCodeOk     = 0
  164. ExitCodeCancel = 1
  165. ExitCodeFatal  = 2
  166.  
  167. KeyNull         = ""
  168. MAXIMUM_ALLOWED   = 33554432
  169. RegistryErrorIndex = NO_ERROR
  170. KeyProduct      = ""
  171. KeyParameters   = ""
  172.  
  173. TRUE            = 1
  174. FALSE           = 0
  175. NoTitle         = 0
  176.  
  177. ExitState   = "Active"
  178. OldVersionExisted = $(FALSE)
  179.  
  180. DriverPath      = $(!STF_NTPATH)\drivers
  181.  
  182. ;***********************************************************************
  183. ; Language-Dependent Dialog Constants
  184. ;***********************************************************************
  185.  
  186. [FileConstantsENG]
  187. ;
  188. ;  Variables to support thermometer gauge and error dialogs
  189. ;
  190. ProCaption   = "Windows NT Setup"
  191. ProCancel    = "Cancel"
  192. ProCancelMsg = "Windows NT Networking is not correctly installed.  "+
  193.                "Are you sure you want to cancel copying files?"
  194.  
  195. ProCancelCap = "Network Setup Message"
  196. ProText1     = "Copying:"
  197. ProText2     = "To:"
  198.  
  199.  
  200. ;
  201. ; Product Info
  202. ;
  203. FunctionTitle = "3COM FDDILINK LAN Adapter Setup"
  204. ;
  205. ; Software
  206. ;
  207. ProductSoftwareDescription = "3COM FDDILINK LAN Adapter Driver"
  208. ;
  209. ; Hardware
  210. ;
  211. ProductHardwareDescription = "3COM FDDILINK LAN Adapter"
  212.  
  213. ;
  214. ; Dialog Message Information
  215. ;
  216. CANNOT_FIND_ANY_CARD       = "Network card is not present in the system"
  217.  
  218.  
  219.  
  220. [DialogConstantsENG]
  221. ;
  222. ; Common button names, etc.
  223. ;
  224. Help        = "&Help"
  225. Exit        = "Cancel"
  226. OK          = "OK"
  227. HelpContext = ""
  228. Continue    = "Continue"
  229. Cancel      = "Cancel"
  230.  
  231. [date]
  232.     ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  233.     ; Minute, Second }
  234.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  235.  
  236. [Source Media Descriptions]
  237.     1  = "3COM FDDILINK Driver Disk"  
  238. ;-----------------------------------------------
  239. ; Input DIALOGS
  240. ;-----------------------------------------------
  241. [FileDependentDlgENG]
  242.  
  243.  
  244.  
  245. ;---------------------------------------------------------------------------
  246. ; 1. Identify
  247. ;
  248. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  249. ;                as we are choosing currently.
  250. ;
  251. ; INPUT:         None
  252. ;
  253. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  254. ;                $($R1): Option Type (COMPUTER ...)
  255. ;                $($R2): Diskette description
  256. ;---------------------------------------------------------------------------
  257.  
  258. [Identify]
  259.     ;
  260.     ;
  261.     read-syms Identification
  262.  
  263.     set !G:DebugOutputControl = 1
  264.  
  265.     set Status     = STATUS_SUCCESSFUL
  266.     set Identifier = $(OptionType)
  267.     set Media      = #("Source Media Descriptions", 1, 1)
  268.  
  269.     Return $(Status) $(Identifier) $(Media)
  270.  
  271. ;------------------------------------------------------------------------
  272. ; 2. ReturnOptions:
  273. ;
  274. ; DESCRIPTION:   To return the option list supported by this INF and the
  275. ;                localised text list representing the options.
  276. ;
  277. ;
  278. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  279. ;
  280. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  281. ;                                STATUS_NOLANGUAGE
  282. ;                                STATUS_FAILED
  283. ;                                STATUS_NOTSUPPORTED
  284. ;
  285. ;                $($R1): Option List
  286. ;                $($R2): Option Text List
  287. ;------------------------------------------------------------------------
  288.  
  289. [ReturnOptions]
  290.     ;
  291.     ;
  292.     set Status        = STATUS_FAILED
  293.     set OptionList     = {}
  294.     set OptionTextList = {}
  295.  
  296.     ;
  297.     ; Check if the language requested is supported
  298.     ;
  299.     set LanguageList = ^(LanguagesSupported, 1)
  300.     Ifcontains(i) $($0) in $(LanguageList)
  301.         ;
  302.         ; Check if the platforms requested is supported
  303.         ;
  304.         ifstr(i) $($1) == ""
  305.             goto returnoptions
  306.         endif
  307.  
  308.         set PlatformList = ^(PlatformsSupported, 1)
  309.         Ifcontains(i) $($1) in $(PlatformList)
  310.             goto returnoptions
  311.         else
  312.             set Status = STATUS_NOTSUPPORTED
  313.             goto finish_ReturnOptions
  314.         endif
  315.     else
  316.         set Status = STATUS_NOLANGUAGE
  317.         goto finish_ReturnOptions
  318.     endif
  319.  
  320.     ;
  321.     ; form a list of all the options and another of the text representing
  322.     ;
  323.  
  324. returnoptions = +
  325.     set OptionList     = ^(Options, 1)
  326.     set OptionTextList = ^(OptionsText$($0), 1)
  327.     set Status         = STATUS_SUCCESSFUL
  328.  
  329. finish_ReturnOptions = +
  330.     Return $(Status) $(OptionList) $(OptionTextList)
  331.  
  332. ;------------------------------------------------------------------------
  333. ;
  334. ; InstallOption:
  335. ;
  336. ;      This section is shelled to by main installation processing
  337. ;      or by NCPASHEL.INF during reconfig, removal, update, etc.
  338. ;
  339. ;
  340. ; FUNCTION:  To copy files representing Options
  341. ;            To configure the installed option
  342. ;            To update the registry for the installed option
  343. ;
  344. ; INPUT:     $($0):  Language to use
  345. ;            $($1):  OptionID to install
  346. ;            $($2):  SourceDirectory
  347. ;            $($3):  AddCopy  (YES | NO)
  348. ;            $($4):  DoCopy   (YES | NO)
  349. ;            $($5):  DoConfig (YES | NO)
  350. ;
  351. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  352. ;                            STATUS_NOLANGUAGE |
  353. ;                            STATUS_USERCANCEL |
  354. ;                            STATUS_FAILED
  355. ;
  356. ;------------------------------------------------------------------------
  357. [InstallOption]
  358.  
  359.     set !G:DebugOutputControl = 1
  360.     ;
  361.     ; Set default values for
  362.     ;
  363.     Debug-Output "At InstallOption"
  364.     set Status   = STATUS_FAILED
  365.     ;
  366.     ; extract parameters
  367.     ;
  368.     set Option   = $($1)
  369.     set SrcDir   = $($2)
  370.     set AddCopy  = $($3)
  371.     set DoCopy   = $($4)
  372.     set DoConfig = $($5)
  373.  
  374.     ;
  375.     ; Check if the language requested is supported
  376.     ;
  377.     set LanguageList = ^(LanguagesSupported, 1)
  378.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  379.         Return STATUS_NOLANGUAGE
  380.     endif
  381.  
  382.     set-subst LF = "\n"
  383.  
  384.     read-syms GeneralConstants
  385.     read-syms FileConstants
  386.  
  387.     read-syms DialogConstants$(!STF_LANGUAGE)
  388.     ifstr(i) $(!NTN_Origination) == "NCPA"
  389.         set Continue = "OK"
  390.     endif
  391.     read-syms FileConstants$(!STF_LANGUAGE)
  392.  
  393.     detect date
  394.  
  395.     set-title  $(FunctionTitle)
  396.  
  397.     set to   = Begin
  398.     set from = Begin
  399. ;
  400. ;  Assume all is well.
  401. ;
  402.     set CommonStatus = STATUS_SUCCESSFUL
  403.  
  404.     EndWait
  405.  
  406. ;
  407. ;   Set up the operation-mode-based variables and welcome
  408. ;   the user.  If the "install mode" variable is improperly set,
  409. ;   assume this is a new installation.
  410. ;
  411.  
  412. Begin = +
  413.     Debug-Output "At Begin"
  414.  
  415.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  416.         set StartLabel = removeadapter
  417.     else-Ifstr(i) $(!NTN_InstallMode) == Update
  418.         set StartLabel = UpgradeSoftware
  419.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  420.         set StartLabel = bindingadapter
  421.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  422.         set StartLabel = configureadapter
  423.         ;
  424.         ;   You cannot config the software component
  425.         ;
  426.         Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  427.             Debug-Output "Cannot configure the LAN596 driver software."
  428.             Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  429.         else
  430.             Debug-Output "Cannot configure the LAN596 driver software."
  431.             Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  432.         endif
  433.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  434.             Debug-Output "ShellCode error: cannot get an error string."
  435.             goto ShellCodeError
  436.         endif
  437.         set Error = $($R0)
  438.         set from = end
  439.         set to = end
  440.         goto nonfatalinfo
  441. ;        endif
  442.     else
  443.         set StartLabel = installadapter
  444.         set OEM_ABANDON_OPTIONS = {}
  445.         set OEM_ABANDON_SOFTWARE = FALSE
  446.         set OEM_ABANDON_ON = TRUE
  447.     endif
  448.  
  449.     Set from = $(fatal)
  450.     Set to = $(fatal)
  451.     Goto $(StartLabel)
  452.  
  453. ;-----------------------------------------------
  454. ; Installation Section
  455. ;-----------------------------------------------
  456.  
  457. installadapter = +
  458.     Debug-Output "At installadapter"
  459. ;
  460. ;   First, check whether the same version of the software exists
  461. ;
  462.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  463.  
  464.     Ifstr $(KeyProduct) != $(KeyNull)
  465.         ;
  466.         ; Same version already existed in the local machine
  467.         ; Popup the dialog and ask the user whether he wants to continue
  468.         ;
  469.         CloseRegKey $(KeyProduct)
  470.  
  471.         ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  472.            ;
  473.            ; Cannot Install the same software again
  474.            ;
  475.            Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  476.                $(ProductVersion)
  477.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  478.                Debug-Output "ShellCode error: cannot get an error string."
  479.                goto ShellCodeError
  480.            endif
  481.  
  482.            goto end
  483.         else
  484.            ;
  485.            ; Add a new adapter card?
  486.            ;
  487.            set OldVersionExisted = $(TRUE)
  488.         endif
  489.     endif
  490.  
  491.  
  492.     goto adapterverify
  493.  
  494. ;-----------------------------------------------
  495. ; Configuration Section
  496. ;-----------------------------------------------
  497. ;
  498. ;   Get the current values of all the parameters
  499. ;
  500. configureadapter = +
  501.     Debug-Output "At configureadapter"
  502.  
  503.     set Error = "Configure: Sorry, not yet implemented."
  504.     goto fatal
  505.  
  506.  
  507.     
  508. adapterverify = +
  509.  
  510.     Debug-Output "At adapterverify"
  511.  
  512.     StartWait
  513.     Debug-Output $(NETCARD_ID)
  514.     Shell $(UtilityInf), EISAFindBus, $(NETCARD_ID)
  515.     ifstr(i) $($R1) != {}
  516.         Debug-Output "EISA Controller NETCARD_ID found!"
  517.         goto CardFound
  518.     endif
  519.     Debug-Output "EISA Controller Search failed!"
  520.     
  521.     set DlgType      = "MessageBox"
  522.     set STF_MB_TITLE = "Error: "$(FunctionTitle)
  523.     set STF_MB_TEXT  = "No Adapters Detected"
  524.     set STF_MB_TYPE  = 1
  525.     set STF_MB_ICON  = 3
  526.     set STF_MB_DEF   = 1
  527.     ui start "Error Message"
  528.     goto setfailed
  529.  
  530. CardFound =  +
  531.     ifstr $($R0) != "NO_ERROR"
  532.         set Error = $($R0)
  533.         goto fatal
  534.     endif
  535.     ifstr(i) $($R1) == {}
  536.         set Error = $(CANNOT_FIND_ANY_CARD)
  537.         set CommonStatus = STATUS_USERCANCEL
  538.         set from = end
  539.         goto nonfatal
  540.     endif
  541.     set AdapterList = $($R1)
  542.     ;
  543.     ; Add Software Component
  544.     ;
  545.     ifint $(OldVersionExisted) == $(FALSE)
  546.         ifstr(i) $(!NTN_InstallMode) == "install"
  547.            Ifstr(i) $(DoCopy) == "YES"
  548.  
  549.               Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  550.  
  551.               Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  552.                   Goto ShellCodeError
  553.               Else-Ifstr(i) $($R0) == STATUS_FAILED
  554.                   Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  555.                   ifint $($ShellCode) != $(!SHELL_CODE_OK)
  556.                       goto ShellCodeError
  557.                   endif
  558.                   set Error = $($R0)
  559.                   Goto fatal
  560.               Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  561.                   Goto successful
  562.               Endif
  563.  
  564.               Set SrcDir = $($R1)
  565.  
  566.            Endif
  567.  
  568.            Debug-Output "At install Install-Option"
  569.         
  570.            install "Install-Option"
  571.            ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  572.               Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  573.               ifint $($ShellCode) != $(!SHELL_CODE_OK)
  574.                   goto ShellCodeError
  575.               endif
  576.               set Error = $($R0)
  577.               goto fatal
  578.            endif
  579.         endif
  580.  
  581.         Debug-Output "At AddSoftwareComponent"
  582.         Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  583.             $(ProductSoftwareName), +
  584.             $(ProductSoftwareName), +
  585.             $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  586.             $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  587.             $(NetEventDLL)
  588.  
  589.         Set OEM_ABANDON_SOFTWARE = TRUE
  590.  
  591.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  592.             Debug-Output "ShellCode error"
  593.             goto ShellCodeError
  594.         endif
  595.         ;
  596.         ;   At this point:
  597.         ;     $R1 contains the product version key handle;
  598.         ;     $R2 contains the NetRules subkey handle;
  599.         ;     $R3 contains the new Services key handle; and
  600.         ;     $R4 contains the Parameters key
  601.         ;     $R5 contains the Linkage Key
  602.         ;
  603.         set RegistryErrorIndex = $($R0)
  604.         set KeyProduct      = $($R1)
  605.         Set SoftNetRulesKey = $($R2)
  606.         CloseRegKey $($R3)
  607.         CloseRegKey $($R4)
  608.         CloseRegKey $($R5)
  609.  
  610.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  611.             EndWait
  612.             Debug-Output "Registry error: add software components"
  613.             CloseRegKey $(KeyProduct)
  614.             CloseRegKey $(SoftNetRulesKey)
  615.             goto fatalregistry
  616.         endif
  617.  
  618.         set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  619.                            {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  620.                            {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  621.                            {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  622.                            {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  623.                            {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  624.                            {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  625.  
  626.         Debug-Output "At AddValueList - SoftwareType"
  627.         Shell  $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  628.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  629.             Debug-Output "ShellCode error."
  630.             goto ShellCodeError
  631.         endif
  632.  
  633.         set RegistryErrorIndex = $($R0)
  634.  
  635.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  636.             EndWait
  637.             Debug-Output "Registry error: add value list."
  638.             CloseRegKey $(KeyProduct)
  639.             CloseRegKey $(SoftNetRulesKey)
  640.             goto fatalregistry
  641.         endif
  642.  
  643.         set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  644.                             {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  645.                             {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  646.                             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  647.                             {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  648.                             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  649.  
  650.         Debug-Output "At AddValueList - bindform"
  651.         Shell  $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  652.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  653.             Debug-Output "ShellCode error."
  654.             goto ShellCodeError
  655.         endif
  656.  
  657.         set RegistryErrorIndex = $($R0)
  658.  
  659.         CloseRegKey $(KeyProduct)
  660.         CloseRegKey $(SoftNetRulesKey)
  661.  
  662.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  663.             EndWait
  664.             Debug-Output "Resgitry error: add value list."
  665.             goto fatalregistry
  666.         endif
  667.     endif
  668. ;
  669. ;   Create the HARDWARE\Netcard region and its corresponding service
  670. ;
  671.     ForListDo $(AdapterList)
  672.         set BusNum = *($($),1)
  673.         set SlotNum = *($($),2)
  674.         Debug-Output "Adding registry parameters, BusNum $(BusNum) SlotNum $(SlotNum)"
  675.         ifstr $(SlotNum) != "0"
  676.             Shell $(UtilityInf), IsNetCardAlreadyInstalled, $(BusNum), +
  677.                 $(SlotNum), $(ProductHardwareDescription), $(ProductHardwareName)
  678.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  679.                 goto ShellCodeError
  680.             endif
  681.             ifstr $($R0) != "NO_ERROR"
  682.                 set Error = $($R0)
  683.                 goto fatal
  684.             endif
  685.             ifstr(i) $($R1) != "YES"
  686.                     Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  687.     
  688.                     ifint $($R4) != -1
  689.                         Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  690.                     endif
  691.                     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  692.                         goto ShellCodeError
  693.                     endif
  694.     
  695.                     set RegistryErrorIndex = $($R0)
  696.                     Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  697.                         EndWait
  698.                         CloseRegKey $($R1)
  699.                         CloseRegKey $($R2)
  700.                         CloseRegKey $($R3)
  701.                         goto fatalregistry
  702.                     endif
  703.                    ;
  704.                    ;   At this point:
  705.                    ;     $R1  Registry key variable for HARDWARE\Netcard\(n)
  706.                    ;     $R2  Registry key variable for HARDWARE\Netcard\(n)\\NetRules
  707.                    ;     $R3  Registry key handle for <service>\Parameters key
  708.                    ;     $R4  Adapter number assigned to adapter
  709.                    ;     $R5  Service name generated by combining svc name with adapter number
  710.                    ;
  711.                     Set HardNetCardKey      = $($R1)
  712.                     Set HardNetRuleKey      = $($R2)
  713.                     Set HardParameterKey    = $($R3)
  714.                     set AdapterNumber       = $($R4)
  715.     
  716.                     set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  717.                                        {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardwareTitle)},+
  718.                                        {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
  719.                                        {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  720.                                        {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  721.                                        {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  722.     
  723.                     Shell  $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
  724.                     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  725.                         goto ShellCodeError
  726.                     endif
  727.                     set NewValueList = {{BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNum)},+
  728.                                        {BusType,$(NoTitle),$(!REG_VT_DWORD),2},+
  729.                                        {MediaType,$(NoTitle),$(!REG_VT_DWORD),3},+
  730.                                        {SlotNumber,$(NoTitle),$(!REG_VT_DWORD),$(SlotNum)},+
  731.                                        {DualHoming,$(NoTitle),$(!REG_VT_DWORD),0},+
  732.                                        {DebugFlags,$(NoTitle),$(!REG_VT_DWORD),34820},+
  733.                                        {RcvBuffSize,$(NoTitle),$(!REG_VT_DWORD),1024},+
  734.                                        {NumRcvDesc,$(NoTitle),$(!REG_VT_DWORD),128},+
  735.                                        {NumXmitDesc,$(NoTitle),$(!REG_VT_DWORD),128},+
  736.                                        {NumXmitFsiDesc,$(NoTitle),$(!REG_VT_DWORD),1024},+
  737.                                        {RxIndicateLimit,$(NoTitle),$(!REG_VT_DWORD),10},+
  738.                                        {TxCompleteLimit,$(NoTitle),$(!REG_VT_DWORD),10},+
  739.                                        {InterruptsSerialized,$(NoTitle),$(!REG_VT_DWORD),1},+
  740.                                        {treq,$(NoTitle),$(!REG_VT_DWORD),165000},+
  741.                                        {tmax,$(NoTitle),$(!REG_VT_DWORD),167772},+
  742.                                        {tvx,$(NoTitle),$(!REG_VT_DWORD),2611},+
  743.                                        {mode,$(NoTitle),$(!REG_VT_DWORD),0}}
  744.                     Shell  $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
  745.                     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  746.                         goto ShellCodeError
  747.                     endif
  748.                      set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  749.                      set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  750.                      set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  751.                                          {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  752.                                         {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  753.                                         {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)} }
  754.                     Shell  $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
  755.                     CloseRegKey $(HardNetCardKey)
  756.                     CloseRegKey $(HardNetRuleKey)
  757.                     CloseRegKey $(HardParameterKey)
  758.                     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  759.                         goto ShellCodeError
  760.                     endif
  761.             endif
  762.         endif
  763.     EndForListDo
  764. ;
  765. ;   REQUIRED:   $(KeyParameters) contains service Parameters key handle
  766. ;
  767. writeparameters = +
  768.     Debug-Output "At writeparameters"
  769.     EndWait
  770.     goto successful
  771.  
  772. ;-----------------------------------------------
  773. ; Binding section
  774. ;-----------------------------------------------
  775. bindingadapter =+
  776.     Debug-Output "At bindingadapter"
  777.     set Error = "Binding: Sorry, not yet implemented."
  778.     goto fatal
  779.  
  780. ;-----------------------------------------------
  781. ; Removeadapter section
  782. ;-----------------------------------------------
  783.  
  784. removeadapter = +
  785.     Debug-Output "At removeadapter"
  786.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  787.         ; Remove Software Component
  788.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  789.             $(ProductSoftwareName)
  790.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  791.             Debug-Output "ShellCode error"
  792.             goto ShellCodeError
  793.         endif
  794.  
  795.         set RegistryErrorIndex = $($R0)
  796.  
  797.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  798.             goto fatalregistry
  799.         endif
  800.     else
  801.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  802.             $(ProductSoftwareName), $(!NTN_RegBase)
  803.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  804.             Debug-Output "ShellCode error"
  805.             goto ShellCodeError
  806.         endif
  807.  
  808.         set RegistryErrorIndex = $($R0)
  809.  
  810.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  811.             goto fatalregistry
  812.         endif
  813.     endif
  814.  
  815.     goto end
  816.  
  817. ;-----------------------------------------------
  818. ; Upgrade Software section
  819. ;-----------------------------------------------
  820.  
  821. UpgradeSoftware = +
  822.     Debug-Output "At UpgradeSoftware"
  823.     ;
  824.     ; First determine whether we want to do upgrade or update for software
  825.     ; or hardware component. Then we will determine whether the Mode is
  826.     ; update or upgrade.
  827.     ;
  828.     ; If the same version of the product existed in the registry, we do
  829.     ; update. Otherwise, we will do a upgrade
  830.     ;
  831.     ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  832.         ; Upgrade software component
  833.         ;
  834.         ; see whether the same version exist or not
  835.         ;
  836.         OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  837.  
  838.         Ifstr $(KeyProduct) != $(KeyNull)
  839.             GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  840.             set Version = *($(VersionInfo), 4)
  841.  
  842.             ;
  843.             ; Update the binaries
  844.             ;
  845.             Split-String $(!NTN_Infname), "\", FilenameList
  846.             QueryListSize ListSize $(FilenameList)
  847.             set !UG_Filename = *($(FilenameList), $(ListSize))
  848.  
  849.             install "Install-Update"
  850.             ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  851.                 goto fatal
  852.             endif
  853.  
  854.             ; Upgrade the version number
  855.             ;
  856.             SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  857.             SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  858.  
  859.             ;
  860.             ; do nothing for update
  861.             ;
  862.             ifint $(Version) != $(ProductVersion)
  863.                ;
  864.                ; If the major version number is not the same,
  865.                ; it is major upgrade. So let Upgrade the product
  866.                ;
  867.                ;
  868.                ; make other upgrade change if necessary
  869.                ;
  870.             endif
  871.             CloseRegKey $(KeyProduct)
  872.         else
  873.             ;
  874.             ; Cannot Open software key, goto ERROR
  875.             ;
  876.             goto fatalregistry
  877.         endif
  878.     else
  879.         ;
  880.         ; upgrade/update hardware component
  881.         ; There is no different between upgrade and update for hardware
  882.         ; component
  883.         ;
  884.         ; 1. Get the Service Name
  885.         ; 2. Change the NetRule section if necessary
  886.         ;
  887.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  888.               $(MAXIMUM_ALLOWED) NetworkCardKey
  889.         Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  890.             ;
  891.             ; Get Service name
  892.             ;
  893.             GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  894.             set ServiceName = *($(ServiceNameInfo), 4)
  895.  
  896.             ;
  897.             ; Change the NetRule if necessary
  898.             ;
  899.             OpenRegKey $(NetworkCardKey) "" "NetRules" +
  900.                 $(MAXIMUM_ALLOWED) NetRuleKey
  901.             Ifstr(i) $(NetRuleKey) != $(KeyNull)
  902.                 ;
  903.                 ; Make the change....
  904.                 ;
  905.             else
  906.                 ;
  907.                 ; Error, cannot open net rules key
  908.                 ;
  909.                 goto fatalregistry
  910.             endif
  911.  
  912.             CloseRegKey $(NetRules)
  913.             CloseRegKey $(NetworkCardKey)
  914.         else
  915.             ;
  916.             ; Error, cannot open network card key
  917.             ;
  918.             goto fatalregistry
  919.         endif
  920.         ;
  921.         ; 3. Change the service section of the hardware. i.e.,
  922.         ;    ParameterName change, value change, etc.
  923.         ;
  924.         OpenRegKey $(!REG_H_LOCAL) "" +
  925.               $(!NTN_ServiceBase)"\"$(ServiceName) +
  926.               $(MAXIMUM_ALLOWED) ServiceKey
  927.  
  928.         Ifstr(i) $(ServiceKey) != $(KeyNull)
  929.             ;
  930.             ; Get the ServiceKey to change the Start value
  931.             ; or Type value. Or open Parameters key to
  932.             ; change the hardware parameters if necessary.
  933.             ;
  934.             CloseRegKey $(ServiceKey)
  935.         else
  936.             ;
  937.             ; Error, cannot open network card key
  938.             ;
  939.             goto fatalregistry
  940.         endif
  941.     endif
  942.  
  943.     goto end
  944.     ;
  945.     ; End of Upgrade Software
  946.     ;
  947.  
  948. ;
  949. ;  Escape hatches
  950. ;
  951. successful = +
  952.     Debug-Output "At successful"
  953.     goto end
  954.  
  955. abandon = +
  956.     Debug-Output "At abandon"
  957.     ForListDo $(OEM_ABANDON_OPTIONS)
  958.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  959.             $(ProductSoftwareName), $($)
  960.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  961.             Debug-Output "ShellCode error"
  962.             goto ShellCodeError
  963.         endif
  964.  
  965.         set RegistryErrorIndex = $($R0)
  966.  
  967.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  968.             goto fatalregistry
  969.         endif
  970.     EndForListDo
  971.  
  972.     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  973.         ; Remove Software Component
  974.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  975.             $(ProductSoftwareName), FALSE
  976.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  977.             Debug-Output "ShellCode error"
  978.             goto ShellCodeError
  979.         endif
  980.  
  981.         set RegistryErrorIndex = $($R0)
  982.  
  983.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  984.             goto fatalregistry
  985.         endif
  986.     endif
  987.  
  988.     goto end
  989.  
  990. ;
  991. ; warning display
  992. ;
  993. warning = +
  994.     Debug-Output "At warning"
  995.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  996.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  997.         goto ShellCodeError
  998.     endif
  999.     ifstr(i) $($R1) == "OK"
  1000.         goto $(to)
  1001.     else-ifstr(i) $($R1) == "CANCEL"
  1002.         goto $(from)
  1003.     else
  1004.         goto "end"
  1005.     endif
  1006. ;
  1007. ; non fatal error display
  1008. ;
  1009. nonfatalinfo = +
  1010.     Debug-Output "At nonfatalinfo"
  1011.     Set Severity = STATUS
  1012.     Set CommonStatus = STATUS_USERCANCEL
  1013.     goto nonfatalmsg
  1014. nonfatal = +
  1015.     Debug-Output "At nonfatal"
  1016.     Set Severity = NONFATAL
  1017.     goto nonfatalmsg
  1018. nonfatalmsg = +
  1019.     Debug-Output "At nonfatalmsg"
  1020.     ifstr(i) $(Error) == ""
  1021.         Set Severity = NONFATAL
  1022.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1023.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1024.             goto ShellCodeError
  1025.         endif
  1026.         set Error = $($R0)
  1027.     endif
  1028.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  1029.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1030.         goto ShellCodeError
  1031.     endif
  1032.     ifstr(i) $($R1) == "OK"
  1033.         goto $(from)
  1034.     else
  1035.         goto "end"
  1036.     endif
  1037.  
  1038. ;
  1039. ;  Registry is broken
  1040. ;
  1041. fatalregistry = +
  1042.     Debug-Output "At fatalregistry"
  1043.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1044.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1045.         goto ShellCodeError
  1046.     endif
  1047.     set Error = $($R0)
  1048.     goto fatal
  1049. ;
  1050. ; fatal error display
  1051. ;
  1052. fatal = +
  1053.     Debug-Output "At fatal"
  1054.     ifstr(i) $(Error) == ""
  1055.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1056.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1057.             goto ShellCodeError
  1058.         endif
  1059.         set Error = $($R0)
  1060.     endif
  1061.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1062.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1063.         goto ShellCodeError
  1064.     endif
  1065.  
  1066.     goto setfailed
  1067.  
  1068. ;
  1069. ;  Shelling error
  1070. ;
  1071. ShellCodeError = +
  1072.     Debug-Output "At ShellCodeError"
  1073.     set DlgType      = "MessageBox"
  1074.     set STF_MB_TITLE = "Error: "$(FunctionTitle)
  1075.     set STF_MB_TEXT  = "Shell Code Error"
  1076.     set STF_MB_TYPE  = 1
  1077.     set STF_MB_ICON  = 3
  1078.     set STF_MB_DEF   = 1
  1079.     ui start "Error Message"
  1080.     goto setfailed
  1081.  
  1082. setfailed = +
  1083.     Debug-Output "At setfailed"
  1084.     set CommonStatus = STATUS_FAILED
  1085.     ;
  1086.     ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  1087.     ;
  1088.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1089.         set OEM_ABANDON_ON = FALSE
  1090.         goto abandon
  1091.     endif
  1092.     goto end
  1093.  
  1094. end = +
  1095.     Debug-Output "At end"
  1096.     goto term
  1097.  
  1098. term = +
  1099.     Debug-Output "At term"
  1100.     Return $(CommonStatus)
  1101.  
  1102.  
  1103. [DebugConfiguration]
  1104.     return
  1105.  
  1106.  
  1107. ;***************************************************************
  1108. ;  INSTALL SECTIONS
  1109. ;***************************************************************
  1110. [Install-Option]
  1111.     Debug-Output "At Install-Option"
  1112.     set STF_VITAL = ""
  1113.  
  1114.     ifstr(i) $(AddCopy) == "YES"
  1115.  
  1116.         Debug-Output "AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers"
  1117.         
  1118.         ;
  1119.         ; Add the files to the copy list
  1120.         ;
  1121.         ;  BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  1122.         ;      the other INF files
  1123.         ;
  1124.         AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1125.  
  1126.     endif
  1127.  
  1128.     ifstr(i) $(DoCopy) == "YES"
  1129.  
  1130.        Debug-Output "CopyFilesInCopyList"
  1131.        
  1132.        ;
  1133.        ; Copy files in the copy list
  1134.        ;
  1135.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1136.        CopyFilesInCopyList
  1137.  
  1138.     endif
  1139.  
  1140.     Exit
  1141.  
  1142. [Install-Update]
  1143.     Debug-Output "At Install-Update"
  1144.    set STF_VITAL        = ""
  1145.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1146.    ;set STF_VERSION     = "YES"
  1147.  
  1148.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1149.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1150.  
  1151.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1152.    CopyFilesInCopyList
  1153.  
  1154.    exit
  1155.  
  1156.